package cn.kgc.utils;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author kgc
 */
@Data
@Component
@PropertySource(value = "classpath:jwt.properties")
@ConfigurationProperties(prefix = "jwt.token")
public class JwtProperties {
    /**
     * 令牌的过期时间
     */
    private String expiration;
    /**
     * 令牌的秘钥
     */
    private String secret;
    /**
     * 令牌的主题(理解为令牌的创建人)
     */
    private String subject;


    public Long getExpiration() {
        return Long.parseLong(expiration);
    }
}
